import request from '@/utils/request'

// 获取会议室列表
export function listMeetingRooms(query) {
  return request({
    url: '/meeting-rooms/page',
    method: 'get',
    params: query
  })
}

// 获取会议室详情
export function getMeetingRoom(id) {
  return request({
    url: `/meeting-rooms/${id}`,
    method: 'get'
  })
}

// 新增会议室
export function addMeetingRoom(data) {
  return request({
    url: '/meeting-rooms',
    method: 'post',
    data: data
  })
}

// 修改会议室
export function updateMeetingRoom(data) {
  return request({
    url: '/meeting-rooms',
    method: 'put',
    data: data
  })
}

// 删除会议室
export function deleteMeetingRoom(id) {
  return request({
    url: `/meeting-rooms/${id}`,
    method: 'delete'
  })
}

// 切换会议室状态
export function toggleMeetingRoomStatus(id) {
  return request({
    url: `/meeting-rooms/${id}/toggle-status`,
    method: 'post'
  })
}

// 获取可用会议室
export function getAvailableRooms(startTime, endTime, capacity) {
  return request({
    url: '/meeting-rooms/available',
    method: 'get',
    params: {
      startTime,
      endTime,
      capacity
    }
  })
} 